<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="utf-8">
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">	
        <meta name="apple-mobile-web-app-capable" content="yes">	
        <meta name="format-detection" content="telephone=no">
        <title>苏轨院-OA办公系统-<?php echo ($title); ?></title>
        <meta name="descption" content="<?php echo ($web["descption"]); ?>" />
        <meta name="keywords" content="<?php echo ($web["keywords"]); ?> " />
    <link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />

<link rel="stylesheet" type="text/css" href="/Public/Admin/common/layui/css/layui.css" media="all"/>
<link rel="stylesheet" type="text/css" href="/Public/Admin/common/bootstrap/css/bootstrap.css" media="all"/>
<link rel="stylesheet" type="text/css" href="/Public/Admin/common/global.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/adminstyle.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css" />

<script type="text/javascript" src="/Public/Admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/Public/Admin/common/layui/layui.js"></script>
<script type="text/javascript" src="/Public/Admin/js/larry.js"></script>
<script type="text/javascript" src="/Public/Admin/js/index.js"></script>
<script type="text/javascript" src="/Public/static/layer/layer.js" ></script>

<!--日历插件-->
<!--<link rel="stylesheet" type="text/css" href="/Public/static/fullcalendar/css/fullcalendar.css">
<link rel="stylesheet" type="text/css" href="/Public/static/fullcalendar/css/jquery-ui.css">
<script src='/Public/static/fullcalendar/js/fullcalendar.min.js'></script>  -->
<link rel="stylesheet" type="text/css" href="/Public/static/datetimepicker-master/jquery.datetimepicker.css">
<script type="text/javascript" src="/Public/static/datetimepicker-master/jquery.datetimepicker.js" ></script>

<!--自定义 css-->
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/page.css">

<!--自定义 js-->
<!--<script type="text/javascript" src="/Public/static/js/formcheck.js" ></script>-->  
<script type="text/javascript" src="/Public/Admin/js/init.js" ></script>







    
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <style>
        @font-face {
            font-family: 'iconfont';  /* project id 645562 */
            src: url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.eot');
            src: url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.eot?#iefix') format('embedded-opentype'),
                url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.woff') format('woff'),
                url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.ttf') format('truetype'),
                url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.svg#iconfont') format('svg');
        }

        .plan_nr{margin-left:5px}
        .plan_nr{position: relative}
        .readFlag{width:6px;height:6px;border-radius: 50%;background: #F74339;display: inline-block;position: absolute;top:17px;left:6px}
        .page .next, .prev, .first{color:#333;}
        .page .current,.page .next:hover,.page .num:hover{border:1px solid #2299ee;}
        .page .num,.current{margin-left:4px;}
        .prev{margin-right: -3px;}
        #page{padding-top: 10px;}
        .width8{width: 8%}
    </style>

</head>
<body class="mian-page">
    <div class="layui-layout layui-layout-admin" id="layui_layout">
        <!-- 顶部区域 -->
<div class="layui-header header header-demo">
    <div class="layui-main">
        <!-- logo区域 -->
        <div class="admin-logo-box">
            <a class="logo" href="javascript:;" title="logo">OA办公平台</a>
<!--            <div class="larry-side-menu">
                <i class="fa fa-bars" aria-hidden="true"></i>
            </div>-->
            <div class="larry-side-menu">
                <i class="" aria-hidden="true">
                    <img src="/Public/Admin/images/menuBar.png" />
                </i>
            </div>
            <div class="fullscreen">
                <img src="/Public/Admin/images/fullScreen.png" onclick="fullScreen()" />
            </div>
        </div>
        <!-- 右侧导航 -->
        <ul class="layui-nav larry-header-item">
            <li class="layui-nav-item">
                <a href="javascript:;" style="padding-right:25px;">
                    <img class="headImg" src="<?php if($userinfo[head] != null): echo ($userinfo["head"]); elseif($userinfo[sex] == 1): ?>/Public/Admin/images/man.png<?php else: ?>/Public/Admin/images/woman.png<?php endif; ?>">
                    <cite><?php echo ($userinfo["user_name"]); ?></cite>
                    <!--<span class="layui-nav-more" style="right:17px;"></span>-->
                </a>
<!--                <dl class="layui-nav-child">
                    <dd>
                        <a class="exit pointer" data-url="<?php echo U('Login/logout');?>">退出</a>
                    </dd>
                </dl>-->
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;" style="padding-right:25px;">
                    <i class="layui-icon"><img src="/Public/Admin/images/user.png" /></i>
                    <span class="layui-badge-dot"><?php echo ($attendCount); ?></span>
                    <span class="layui-nav-more" style="right:10px;"></span>
                </a>
                <div class="layui-nav-child stateBox" id="stateBox">
                    <div class="search">
                        <i class="layui-icon layui-icon-notice"><img src="/Public/Admin/images/searchiIcon.png" /></i>
                        <input type="text" placeholder="搜索人员" class="searchUser" value="" data-url="<?php echo U(searchUser);?>"/>
                    </div>
                    <ul>
                        <li class="item item-hide" state="hide">
                            <a>
                                <span>外出人员</span>
                                <label class="color1"><?php echo ($outCount); ?></label>
                                <em class="arrow"></em>
                            </a>
                            <dl>
                                <?php if(is_array($outList)): foreach($outList as $key=>$out): ?><dd>
                                        <img src="<?php echo ($out["head"]); ?>" />
                                        <span><?php echo (getChineseName($out["user_id"])); ?></span>
                                    </dd><?php endforeach; endif; ?>
                            </dl>
                        </li>
                        <li class="item item-hide" state="hide">
                            <a>
                                <span>出差人员</span>
                                <label class="color3"><?php echo ($evectionCount); ?></label>
                                <em class="arrow"></em>
                            </a>
                            <dl>
                                <?php if(is_array($evectionList)): foreach($evectionList as $key=>$evection): ?><dd>
                                        <img src="<?php echo ($evection["head"]); ?>" />
                                        <span><?php echo (getChineseName($evection["user_id"])); ?></span>
                                    </dd><?php endforeach; endif; ?>
                            </dl>
                        </li>
                        <li class="item item-hide" state="hide">
                            <a>
                                <span>请假人员</span>
                                <label class="color2"><?php echo ($leaveCount); ?></label>
                                <em class="arrow"></em>
                            </a>
                            <dl>
                                <?php if(is_array($leaveList)): foreach($leaveList as $key=>$leave): ?><dd>
                                        <img src="<?php echo ($leave["head"]); ?>" />
                                        <span><?php echo (getChineseName($leave["user_id"])); ?></span>
                                    </dd><?php endforeach; endif; ?>
                            </dl>
                        </li>
                    </ul>
                </div>
            </li>
        </ul>
    </div>
</div>
<script>
    $(initLogin());
    
    $("#stateBox>ul").height(window.innerHeight - 135);
    $(document).on("click", "#stateBox li>a", function () {
        var state = $(this).parents("li").attr("state");
        if (state == "hide") {
            $(this).parents("li").attr("state", "show");
            $(this).parents("li").addClass("item-show").removeClass("item-hide");
        } else if (state == "show") {
            $(this).parents("li").attr("state", "hide");
            $(this).parents("li").addClass("item-hide").removeClass("item-show");
        }
    })

    
    //全屏
    function fullScreen() {
        var el = document.documentElement;
        var rfs = el.requestFullScreen || el.webkitRequestFullScreen || 
        el.mozRequestFullScreen || el.msRequestFullScreen;
        if(typeof rfs != "undefined" && rfs) {
            rfs.call(el);
        } else if(typeof window.ActiveXObject != "undefined") {
    //for IE，这里其实就是模拟了按下键盘的F11，使浏览器全屏
            var wscript = new ActiveXObject("WScript.Shell");
            if(wscript != null) {
                    wscript.SendKeys("{F11}");
            }
        }
    }
</script>


        <!-- 左侧侧边导航开始 -->
<div class="layui-side layui-side-bg layui-larry-side" id="larry-side">
    <div class="layui-side-scroll" id="larry-nav-side" lay-filter="side">

        <!-- 左侧菜单 -->
        <ul class="layui-nav layui-nav-tree">
            <li class="layui-nav-item layui-this">
                <a href="<?php echo U('Index/index');?>">
                    <i class="iconfont homeIcon"></i>
                    <span>首页</span>
                </a>
            </li>
            <!-- 个人信息 -->
            <?php if(is_array($userMenus)): foreach($userMenus as $key=>$menu): ?><li class="layui-nav-item layui-child">
                    <a href="javascript:;" data-url="<?php echo ($menu["url"]); ?>" class="parentCate">
                        <i class="iconfont leftIcon<?php echo ($key+1); ?>" ></i>
                        <span><?php echo ($menu["name"]); ?></span>
                        <em class="layui-nav-more"></em>
                    </a>
                    <dl class="layui-nav-child">
                        <?php if(is_array($menu["child"])): foreach($menu["child"] as $key=>$child): ?><dd>
                                <a href="<?php if($child[param] != null): ?>/index.php/Home/<?php echo ($child["url"]); ?>&<?php echo ($child["param"]); else: ?>/index.php/Home/<?php echo ($child["url"]); endif; ?>" data-url="/index.php/Home/<?php echo ($child["url"]); ?>">
                                    <i class="iconfont" style="font-size:10px;">></i>
                                    <span style="font-size:13px;"><?php echo ($child["name"]); ?></span>
                                </a>
                            </dd><?php endforeach; endif; ?>
                    </dl>
                </li><?php endforeach; endif; ?>
        </ul>
    </div>
</div>
<!-- 左侧侧边导航结束 -->

        <!-- 右侧主体内容 -->
        <input type="hidden" id="loginUser" value="<?php echo ($user); ?>">
        <div class="layui-body" id="larry-body" style="bottom: 0;border-left: solid 2px #2299ee;">
            <div class="layui-tab layui-tab-card larry-tab-box" id="larry-tab" lay-filter="demo" lay-allowclose="true">
                <div class="go-left key-press pressKey" id="titleLeft" title="滚动至最右侧"><i class="larry-icon larry-weibiaoti6-copy"></i> </div>
                <ul class="layui-tab-title" style="display: none;">
                    <li class="layui-this" id="admin-home"><i class="iconfont icon-diannao1"></i><em>后台首页</em></li>
                </ul>
                <div class="go-right key-press pressKey" id="titleRight" title="滚动至最左侧"><i class="larry-icon larry-right"></i></div> 
                <ul class="layui-nav closeBox" style="display: none;">
                    <li class="layui-nav-item">
                        <a href="javascript:;"><i class="iconfont icon-caozuo"></i> 页面操作</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;" class="refresh refreshThis"><i class="layui-icon">&#x1002;</i> 刷新当前</a></dd>
                            <dd><a href="javascript:;" class="closePageOther"><i class="iconfont icon-prohibit"></i> 关闭其他</a></dd>
                            <dd><a href="javascript:;" class="closePageAll"><i class="iconfont icon-guanbi"></i> 关闭全部</a></dd>
                        </dl>
                    </li>
                </ul>
                <div class="layui-tab-content" style="min-height: 150px; ">
                    <div class="layui-tab-item layui-show" id="main">
                         
    <section class="layui-larry-box">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <form method="get">
                        <div class="layui-inline width8">
                            <span class="btn-upload form-group">
                                <!--<a class="btn btn-primary search" data-url="<?php echo U('index');?>"><i class="Hui-iconfont">&#xe67a;</i> 计划类型</a>-->
                                <select name="pType" class="layui-input search_input">
                                    <option value="">按类型</option>
                                    <?php if(is_array($planType)): foreach($planType as $key=>$type): ?><option value="<?php echo ($type["type_id"]); ?>" <?php echo ($pType == $type['type_id'] ? 'selected' : ''); ?>><?php echo ($type["type_name"]); ?></option><?php endforeach; endif; ?>
                                </select>
                            </span>
                        </div>
                        <div class="layui-inline width8">
                            <span class="btn-upload form-group">
                                <!--<a class="btn btn-primary search" data-url="<?php echo U('index');?>"><i class="Hui-iconfont">&#xe67a;</i> 计划类型</a>-->
                                <select name="child_type" class="layui-input search_input">
                                    <option value="">按标记</option>
                                    <?php if(is_array($planFlag)): foreach($planFlag as $key=>$flag): ?><option value="<?php echo ($flag["type_id"]); ?>" <?php echo ($pFlag == $flag['type_id'] ? 'selected' : ''); ?>><?php echo ($flag["type_name"]); ?></option><?php endforeach; endif; ?>
                                </select>
                            </span>
                        </div>
                        <?php if(!empty($depts)): ?><div class="layui-inline width8">
                                <span class="btn-upload form-group">
                                    <!--<a class="btn btn-primary search" data-url="<?php echo U('index');?>"><i class="Hui-iconfont">&#xe67a;</i>部门</a>-->
                                    <select name="to_id" class="layui-input search_input">
                                        <option value="">按部门</option>
                                        <?php if(is_array($depts)): foreach($depts as $key=>$dept): ?><option value="<?php echo ($dept["dept_id"]); ?>" <?php echo ($deptName == $dept['dept_id'] ? 'selected' : ''); ?>><?php echo ($dept["dept_name"]); ?></option><?php endforeach; endif; ?>
                                    </select>
                                </span>
                            </div><?php endif; ?>
                        <div class="layui-inline width8">
                            <span class="btn-upload form-group">
                                <!--<a class="btn btn-primary search" data-url="<?php echo U('index');?>"><i class="Hui-iconfont">&#xe67a;</i>等级</a>-->
                                <select name="level" class="layui-input search_input">
                                    <option value="">按等级</option>
                                    <option value="1" <?php echo ($level == 1 ? 'selected' : ''); ?>>个人级</option>
                                    <option value="2" <?php echo ($level == 2 ? 'selected' : ''); ?>>部门级</option>
                                </select>
                            </span>
                        </div>
                        <div class="layui-inline width8">
                            <span class="btn-upload form-group">
                                <!--<a class="btn btn-primary search" data-url="<?php echo U('index');?>"><i class="Hui-iconfont">&#xe67a;</i>等级</a>-->
                                <select name="sms_flag" class="layui-input search_input">
                                    <option value="">按状态</option>
                                    <option value="0" <?php echo ($smsFlag == 0 ? 'selected' : ''); ?>>进行中</option>
                                    <option value="1" <?php echo ($smsFlag == 1 ? 'selected' : ''); ?>>已结束</option>
                                </select>
                            </span>
                        </div>
                        <div class="layui-input-inline" style="width:10%">
                            <input type="text" name="plan_name" placeholder="计划标题" value="<?php echo ($planName); ?>" class="layui-input search_input">
                        </div>
                        <div class="layui-input-inline" style="width:40%">
                            <input type="text" name="start" placeholder="开始时间" value="<?php echo ($start); ?>" class="layui-input search_input datepickerInput" style="width:25%;display:inline-block"> &nbsp;至&nbsp; <input type="text" name="end" placeholder="结束时间" value="<?php echo ($end); ?>" class="layui-input search_input datepickerInput" style="width:25%;display:inline-block">
                            <a class="layui-btn search_btn search" data-url="<?php echo U('index');?>" style="margin-left:10px;"> 查询</a>
                        </div>
                        <!--加条件时，type=0-->
                        <input type='hidden' name='type' value='0'>
                        <input type="hidden" name="p" value="1" />
                    </form>
                </blockquote>
                <div class="layui-block" style="text-align:right;margin-top:8px;margin-bottom:8px;">
                    <a class="layui-btn search_btn" href="<?php echo U('save');?>" style="font-size:14px;"> 新建计划</a>
                </div>
                <div class="layui-tab-content larry-personal-body clearfix mylog-info-box">
                    <!-- 计划列表 -->
                    <div class="layui-tab-item layui-field-box layui-show">
                        <table class="layui-table table-hover" lay-even="" lay-skin="nob">
                            <thead>
                                <tr>
                                    <!--<th><input type="checkbox" id="selected-all"></th>-->
                                    <th>序号</th>
                                    <th>标题</th>
                                    <!--                                    <th>类型</th>
                                                                        <th>等级</th>-->
                                    <!--                            <?php if($isLeader == true): ?><th>部门</th><?php endif; ?>-->
                                    <th width="12%">开始时间</th>
                                    <th width="12%">负责人/执行人</th>
                                    <!--<th>创建人</th>-->
                                    <!--<th>状态</th>-->
                                    <th width="7%">总进度</th>
                                    <th width="7%">标的物</th>
                                    <th width="6%">关注</th>
                            <?php if($isLeader == 1): ?><th width="6%">提醒</th><?php endif; ?>
                            <th width="10%">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if(!empty($data)): if(is_array($data)): foreach($data as $key=>$row): ?><tr>
                                        <!--<td><input type="checkbox"></td>-->
                                        <td class="plan_nr">
                                    <?php if($row['noRead'] == 1): ?><span class="readFlag"></span><?php endif; ?>
                                    <?php echo ($row["num"]); ?>
                                    </td>
                                    <td><a href="<?php echo U('show',array('id'=>$row['plan_id'],'type'=>$condition,'pType'=>$pType,'level'=>$level,'sms_flag'=>$row['sms_flag'],'plan_name'=>$planName,'start'=>$start,'end'=>$end,'to_id'=>$deptName));?>" title="<?php echo ($row["fullName"]); ?>"><?php echo ($row["name"]); ?></a></td>
                                    <!--                                        <td><?php echo (getPlanType($row["type"])); if($row['child_type'] != null): ?>（<?php echo ($row["child_type"]); ?>）<?php endif; ?></td>
                                                                        <td><?php if($row['level'] == 1): ?>个人级<?php elseif($row['level'] == 2): ?>部门级<?php else: ?>未选择等级<?php endif; ?></td>-->
                                    <!--                                    <?php if($isLeader == true): ?><td><?php if($deptName != null): echo (getDeptName($deptName)); endif; ?></td><?php endif; ?>-->
                                    <td><?php echo ($row["begin_date"]); ?></td>
                                    <td><?php if($row['executor'] != null): echo (getMoreUsername($row["executor"])); else: echo ($row["manager"]); endif; ?></td>
                                    <!--                                    <td><?php echo (getChineseName($row["creator"])); ?></td>
                                                                        <td><?php echo ($row['sms_flag'] ? '已结束' : '进行中'); ?></td>-->
                                    <td><?php echo ($row["total_percent"]); ?>%</td>
                                    <td><?php echo ($row['uploads_url']? '有' :'无'); ?></td>
                                    <td>
                                        <a class="ml-5 pointer follow" data-id="<?php echo ($row["plan_id"]); ?>" title="<?php echo ($row['follow'] ? '取消关注' : '关注'); ?>">
                                            <?php if($row['follow'] == 1): ?><img src="/Public/Admin/images/gz1.png">
                                                <?php else: ?>
                                                <img src="/Public/Admin/images/gz2.png"><?php endif; ?>
                                        </a>
                                    </td>
                                    <?php if($isLeader == 1): ?><td>
                                        <?php if($row['remind'] == null): ?><a class="ml-5 remind pointer" data-url="<?php echo U('remind',array('id'=>$row['plan_id']));?>" title="发送提醒"><img src="/Public/Admin/images/no_remind.png"></a> 
                                            <?php else: ?>
                                            <a class="ml-5 remind pointer" data-url="<?php echo U('remind',array('id'=>$row['plan_id']));?>" title="上次提醒时间：<?php echo ($row["remind"]); ?>"><img src="/Public/Admin/images/remind.png"></a><?php endif; ?>
                                        </td><?php endif; ?>
                                    <td>
                                        <a style="text-decoration:none;display:inline-block;width:20px;" href="/index.php/Home/Plan/save?id=<?php echo ($row["plan_id"]); ?>&type=<?php echo ($row["type"]); ?>&pType=<?php echo ($pType); ?>&deptName=<?php echo ($deptName); ?>&level=<?php echo ($level); ?>&smsFlag=<?php echo ($smsFlag); ?>&planName=<?php echo ($planName); ?>&start=<?php echo ($start); ?>&end=<?php echo ($end); ?>&p=<?php echo ($p); ?>" title="编辑"><i class="iconfont icon-xiugai" style="font-size:15px;"> </i></a> 
                                        <div style="display:inline-block;width:20px;">
                                            <?php if($row[is_manager] == 1): if($row[sms_flag] == 0): ?><a style="text-decoration:none;" class="ml-5 theend" data-type="1" data-url="<?php echo U('theend',array('id'=>$row['plan_id'],'type'=>1));?>"  title="强制结束">
                                                        <i class="iconfont pointer" style="font-size:20px;position: relative;top:2px;">&#xe6fe;</i>
                                                    </a>
                                                    <?php else: ?>
                                                    <a style="text-decoration:none;" class="ml-5 theend" data-type="0" data-url="<?php echo U('theend',array('id'=>$row['plan_id'],'type'=>0));?>"  title="强制开始">
                                                        <i class="iconfont pointer" style="font-size:20px;position: relative;top:2px;">&#xe6b8;</i>
                                                    </a><?php endif; endif; ?>
                                        </div>
                                        <div style="display:inline-block;width:20px;">
                                            <?php if($row[is_creator] == 1): ?><a style="text-decoration:none;display:inline-block;width:20px;" class="ml-5 delete" data-url="<?php echo U('delete',array('id'=>$row['plan_id']));?>"  title="删除"><i class="iconfont icon-shanchu3" style="color:#666;font-size:15px;"></i></a><?php endif; ?>
                                        </div>
                                    </td>
                                    </tr><?php endforeach; endif; ?>
                                <?php else: ?>
                                <tr><td colspan="8" style="border-bottom: 1px solid #fff;border-left: 1px solid #fff;text-align: left">暂无数据</td></tr><?php endif; ?>
                            </tbody>
                        </table>
                        <div class="layui-block">共<?php echo ($count); ?>条数据</div>
                        <div class="larry-table-page clearfix">
                            <input type='hidden' id="followUrl" value="<?php echo U('attentPlan');?>">
                            <!--<a href="javascript:;" class="layui-btn layui-btn-small"><i class="iconfont icon-shanchu1"></i>删除</a>-->
                            <div id="page" class="page"><?php echo ($page); ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

                    </div>
                </div>
            </div>
        </div>
        <!-- 底部区域 
        <div class="layui-footer layui-larry-foot" id="larry-footer">
            <div class="layui-mian">  
                <p class="p-admin">
                    <span>2017 &copy;</span>
                    版权所有
                </p>
            </div>
        </div>-->
    </div>
    <div class="lock-screen" style="display: none;">
        <div id="locker" class="lock-wrapper">
            <div id="time"></div>
            <div class="lock-box center">
                <!--<img src="images/userimg.jpg" alt="">-->
                <h1>admin</h1>
                <duv class="form-group col-lg-12">
                    <input type="password" placeholder='锁屏状态，请输入密码解锁' id="lock_password" class="form-control lock-input" autofocus name="lock_password">
                    <button id="unlock" class="btn btn-lock">解锁</button>
                </duv>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="/Public/Admin/js/plan.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <script type="text/javascript">
        $(dateTime(0));
        $(initPlanIndex());


    </script>    


</body>
</html>